cc.Class({
    extends: cc.Component,

    properties: {
        btnBind: cc.Node,
        txtBtn: cc.Label,
        txtTitle: cc.Label,
        txtContent: cc.Label,
        txtTips: cc.Label,
    },

    onLoad() {
        this.btnBind.on('click', this.onClick, this);
        this.txtTitle.string = LangPublic.W301;
        this.txtTips.string = LangPublic.W303;
        this.txtContent.string = LangPublic.W302.format(688);
        this.txtBtn.string = LangPublic.W304;
        cc.Emitter.on(EVENTS.GET_TOKEN, this.onGetToken, this);
    },

    onDestroy() {
        cc.Emitter.off(EVENTS.GET_TOKEN, this.onGetToken, this);
    },

    onGetToken() {
        if(!LINK.isGuestLogin) this.node.emit('close');
    },

    onClick() {
        cc.Proxy.userBind();
    }
});
